<?php
include "site.php";
include "oauth.php";

/* role name */
define("ROLE_GUEST", "guest");
define("ROLE_MEMBER", "member");
define("ROLE_ADMIN", "admin");

define("APP_ID", "100641317");
define("APP_KEY", "e925079ca47eda4d1f3e8d7ff68046f2");

define("FIRST_TITLE", "家谱百科");
define("SECOND_TITLE", "家谱的百科全书");

/* directories of static files */
define("SITE_DIR", "");
define("IMG_DIR", SITE_DIR."/Public/Img");
define("CSS_DIR", SITE_DIR."/Public/Css");
define("JS_DIR", SITE_DIR."/Public/Js");

define("TMP_DIR", "/Data/tmp");
define("FIGURE_DIR", "/Data/figure");
define("ALBUM_DIR", "/Data/album");

define("NAME_LENGTH", 3);
define("RELATIVE_LEVEL", 2);	/* how many level of relationship  with the original user would be shown in family tree */

/* log file location */
define("LOG_FILE", WEB_ROOT."/Log/".date("Y-m-d").".log");

/* relations define */
define("FATHER", "father");
define("MOTHER", "mother");
define("WIFE", "wife");
define("SON", "son");
define("DAUGHTER", "daughter");
define("HUSBAND", "husband");

/* gender */
define("MALE", "male");
define("FEMALE", "female");

define("QIN_TREE_WIDTH", 720); //760
define("QIN_TREE_HEIGHT", 400);
define("QIN_TREE_MARGIN", 10);

/* ImageMagick location */
/* define("CONVERT_PROGRAM", '"c:\\Program Files\\ImageMagick-6.7.8-Q16\\convert.exe"'); */
define("CONVERT_PROGRAM", "convert");

/* request table state */
define("REQUEST_INIT", "init");
define("REQUEST_AGREE", "agree");
define("REQUEST_CANCEL", "cancel");

/* JSON return code */
define("RESP_OK", "0000");
define("RESP_DB_FAILED", "0001");
define("RESP_USER_NOT_FOUND", "0002");
define("RESP_PARA_ERROR", "0003");
define("RESP_USER_ID", "0004");
define("RESP_USER_EXISTS", "0005");

/* resize photo in different rank */
define("SIZE_EXLARGE", 1024*1024*8); /* 8M */
define("SIZE_LARGE",   1024*1024*4); /* 4M */
define("SIZE_MEDIUM",  1024*1024*2); /* 2M */
define("SIZE_SMALL",   1024*1024*1); /* 1M */

define("SCALE_EXLARGE", "12.5%");
define("SCALE_LARGE",   "25%");
define("SCALE_MEDIUM",  "50%");
define("SCALE_SMALL",   "100%");

define("MALE_FIGURE", "/Public/Img/male.png");
define("FEMALE_FIGURE", "/Public/Img/female.png");

define("ITEM_COUNT_PER_PAGE", 20);
define("SURNAMES_PER_LINE", 10);
define("USERS_PER_SURNAME_PAGE", 60);

define("HOT_PEOPLE_NUM", 36);
define("HOT_FAMILY_MEMBER_NUM", 20);
define("HOT_PEOPLE_IDS", "hot-people.ids");
define("ACTIVE_PEOPLE_PAGE", "/Public/html/active_people.html");
define("ACTIVE_PEOPLE_PATH", WEB_ROOT.ACTIVE_PEOPLE_PAGE);
define("PHOTO_WALL_URL", "/Public/html/photo_wall.html");
define("PHOTO_WALL_PATH", WEB_ROOT.PHOTO_WALL_URL);
define("PHOTO_MAX_ANGLE", 5);
define("MAX_PHOTO_NUM_ON_PHOTO_WALL", 50);
define("PHOTO_THUMB_HEIGHT", 160);
define("SURNAMES", "Public/surnames.txt");
define("SURNAMES_HTML", "/Public/html/surnames.html");
define("SURNAMES_PATH", WEB_ROOT.SURNAMES_HTML);
define("LATEST_PEOPLE_HTML", "/Public/html/latest_people.html");
define("LATEST_PEOPLE_PATH", WEB_ROOT.LATEST_PEOPLE_HTML);

define("AFFILIATE_DIR", "/Public/affiliate");
define("AFFILIATE_PATH", WEB_ROOT.AFFILIATE_DIR);

define("ACTIVE_EXPIRED", 3600 * 1); /* refresh active users every an hour */

define("FAMILY_OPEN_PUBLIC", "public");
define("FAMILY_OPEN_PROTECT", "protect");
define("FAMILY_OPEN_PRIVATE", "private");

define("RESOURCE_STATE_INIT", "init");
define("RESOURCE_STATE_DELETED", "deleted");

define("SUBSCRIBE_STATE_INIT", "init");
define("SUBSCRIBE_STATE_VALIDATE", "validate");

define("CONTENT_TYPE_FAMILY", "family");
define("CONTENT_TYPE_USER", "user");
define("CONTENT_TYPE_RELATION", "relation");
define("CONTENT_TYPE_EVENT", "event");
define("CONTENT_TYPE_PHOTO", "photo");

define("OPERATE_TYPE_ADD", "add");
define("OPERATE_TYPE_EDIT", "edit");
define("OPERATE_TYPE_DELETE", "delete");
define("OPERATE_TYPE_RESTORE", "restore");

define("APC_CACHE_LIFE_TIME", 120);
define("DEFAULT_USER_IN_HOME", 654);
define("USE_BETTER_BROWSER", "");//"使用<a href='http://firefox.com.cn/' target='blank'>Firefox</a>，<a href='http://www.google.cn/chrome/intl/zh-CN/landing_chrome.html?hl=zh-CN' target='blank'>Chrome</a>，<a href='http://info.msn.com.cn/ie9/' target='blank'>IE9</a>， <a href='http://www.opera.com/' target='blank'>Opara</a>等支持HTML5的浏览器可获得更好的视图。<a href='http://firefox.com.cn/' target='blank'>立即下载</a>");
define("CACHE_HINT", "您所做的改动将在2分钟内更新。");

/* define QQ API */
//define("API_SERVER", "119.147.19.43");
define("API_SERVER", "openapi.tencentyun.com");
define("DEFAULT_QQ_PF", "pengyou");


